package com.splic.product.cusEnum;

/**
 * ==========================
 * 开发：singe
 * 创建时间：2022-02-28 22:11
 * 版本: 1.0
 * 描述：TODO
 * ==========================
 */
public enum FailEnum {
    MINUSONE(-1,"上传失败"),
    ZERO(0,"音频正常执行"),
    ONE(1,"音频上传失败"),
    TWO(2,"音频转码失败"),
    THREE(3,"音频识别失败"),
    FOUR(4,"音频时长超限（最大音频时长为 5 小时）"),
    FIVE(5,"音频校验失败（duration 对应的值与真实音频时长不符合要求）"),
    SIX(6,"静音文件"),
    SEVEN(7,"翻译失败"),
    EIGHT(8,"账号无翻译权限"),
    NINE(9,"转写质检失败"),
    TEN(10,"转写质检未匹配出关键词"),
    ELEVEN(11,"upload接口创建任务时，未开启质检或者翻译能力"),
    OTHER(99,"其他");

    private Integer code;
    private String des;

    public Integer getCode() {
        return code;
    }

    public String getDes() {
        return des;
    }

    FailEnum(Integer code, String des) {
        this.code = code;
        this.des = des;
    }

    public static String getDesByCode(Integer code) {
        String result = null;
        for (FailEnum order : FailEnum.values()) {
            if (order.getCode().equals(code)) {
                result = order.getDes();
                break;
            }
        }
        return result;
    }

}